home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Tools - Objects / MacApp / MacApp CD Release / MacApp 2.0.1 (Many Libraries) / Interfaces / CIncludes / UPrinting.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-10-25  |  26.4 KB  |  553 lines  |  [TEXT/MPS ]

  1. /*[a-,body+,h-,o=100,r+,rec+,t=4,u+,#+,j=20/57/1$,n-]*/
  2. /* UPrinting.p */
  3. /* Copyright © 1986-1990 by Apple Computer Inc. All rights reserved. */
  4. #ifndef  __UPrinting__
  5. #define __UPrinting__  0
  6. #endif
  7. #if  ! __UPrinting__
  8. #define __UPrinting__  1
  9.  
  10.         /* • Required for this unit's interface. Auto-Include them */
  11. #ifndef  __UMacApp__
  12. #include "UMacApp.h"
  13. #endif
  14. #ifndef  __DIALOGS__
  15. #include "Dialogs.h"
  16. #endif
  17. #if  ! qNeedsROM128K
  18. #ifndef  __PRINTING__
  19. #include "Printing.h"
  20. #endif
  21. #else
  22. #ifndef  __PRINTTRAPS__
  23. #include "PrintTraps.h"
  24. #endif
  25. #endif
  26.  
  27.             /* Command constants */
  28. const short cChangePrinterStyle = 192;
  29.    /* Command arising from user's making changes
  30.                                                          in Page Setup... dialog */
  31. const short cShowBreaks            = 201;                    /* “Show Page Breaks” command */
  32.  
  33.             /* Printing-related command numbers which apply only when a view with a non-null PrintHa
  34.                ndler
  35.             is in the target chain */
  36.  
  37.             /* Dialogs */
  38. const short phSpoolPrintDialog    = 257;                    /* the dialog shown when printing a file (a
  39.                                                          misnomer - not just when spooled) */
  40. const short phFinderPrintDialog = 258;                    /* the dialog shown when doing Finder
  41.                                                          Printing; differs from prev. by addition
  42.                                                          of a 'Cancel All Printing' button */
  43.  
  44.             /* Alerts */
  45. const short phNoPages            = 251;                    /* The “no pages within requested range”
  46.                                                          alert */
  47.  
  48.             /* Dialogs */
  49. const short phWhichDoc            = 261;                    /* The “Preparing to print <docname>” dialog
  50.                                                          used during Finder printing */
  51.  
  52.             /* Miscellaneous */
  53. const short kUsualPages            = SHRT_MAX;                /* For methods that take a “pageNumber”
  54.                                                          argument, this value indicates a request
  55.                                                          for a general setting rather than a
  56.                                                          setting customized to one particular page
  57.                                                          */
  58.  
  59. const short kNeverInitialized    = SHRT_MAX;                /* Pseudo-value for fPrinterDev field of
  60.                                                          TStdPrintHandler; used to trigger an
  61.                                                          initial PrinterChanged call */
  62.  
  63. const long kPrintDriverName       = 0xE000;
  64.    /* STR resource in System file which contains
  65.                                                          name of the current print driver */
  66.  
  67. struct PageAreas {
  68.     Rect thePaper;                                        /* physical page */
  69.     Rect theInk;                                        /* printable page */
  70.     Rect theMargins;
  71.        /* top-left positive; bottom-right negative */
  72.     Rect theInterior;
  73.        /* rect into which view-subset is projected */
  74. };
  75.  
  76. class TStdPrintHandler : public TPrintHandler {
  77.   public:
  78.    /* Actually Implements all the features that
  79.                                                           were stubbed out in its ancestor. Basic
  80.                                                           flow of control at print time: Print,
  81.  
  82.                                                           CheckPrinter, For each page(
  83.                                                           FocusOnBorder, DrawPageInterior,
  84.  
  85.                                                           FocusOnBorder, AdornPage) are called. */
  86.     PageAreas fPageAreas;                                /* metrics for printing */
  87.  
  88.     VRect fPrintExtent;                                    /* the part of the view's extent that is to
  89.                                                          be printed by this print handler. The
  90.                                                          default is the entire extent, but it can
  91.                                                          be changed with the method SetAreaToPrint.
  92.                                                          */
  93.  
  94.     Boolean fFixedSizePages[2];
  95.                                                         /* Indicates whether pages are fixed size
  96.                                                         horzontally and vertically. */
  97.  
  98.     Handle fHPrint;                                        /* actually of THPrint, a MacPrint type. The
  99.                                                          Print Record is 120 bytes long,
  100.     and may be
  101.                                                          shared among all PrintHandlers in a
  102.                                                          document or may be unique to each
  103.                                                          PrintHandler, depending on the flag
  104.                                                          TDocument.fSharePrintInfo */
  105.  
  106.     Point fPageStrips;                                    /* For printing a view which will take more
  107.                                                          than one page to print, the view is
  108.                                                          thought of as being divided up by vertical
  109.                                                          and horizontal lines ('page breaks') into
  110.                                                          a checkerboard of 'pages'. A vertical
  111.                                                          column, one page wide, of such pages is
  112.                                                          called a 'vertical page strip',
  113.     while a
  114.                                                          horizontal row, one page high, of such
  115.                                                          pages is called a 'horizontal page strip'.
  116.                                                          The number of vertical page strips is
  117.                                                          represented by fPageStrips.v, and the
  118.                                                          number of horizontal page strips is
  119.                                                          represented by fPageStrips.h In a typical
  120.                                                          Word Processor application, there is only
  121.                                                          one vertical strip of pages, but many
  122.                                                          horizontal 'strips', each one only one
  123.                                                          page wide. In a graphical application,
  124.  
  125.                                                          there may be many vertical as well as
  126.                                                          horizontal strips of pages. fPageStrips is
  127.                                                          recomputed by method CalcPageStrips. */
  128.  
  129.     short fStartPage;
  130.        /* the page number for the topleftmost corner
  131.                                                          of the view. Normally 1, but can be set to
  132.                                                          any positive value */
  133.  
  134.     short fPrinterDev;                                    /* MacPrint's device number for printer; use
  135.                                                          this at Print time for getting font
  136.                                                          metrics in device coordinates */
  137.  
  138.     long fLastCheckedPrinter;                            /* The time that the user's chosen Printer
  139.                                                          and my own idea of printer metrics were
  140.                                                          last known to be in harmony */
  141.  
  142.     StringHandle fLastPrinterName;
  143.        /* The name of the current printer driver, at
  144.                                                          fLastCheckedPrinter. */
  145.  
  146.     VHSelect fPageDirection;
  147.        /* Determines how page numbers are to advance
  148.                                                          in a large view which is more than one
  149.                                                          page wide and more than one page high; v
  150.                                                          means page 2 is BELOW page 1; h means it's
  151.                                                          to its RIGHT. Irrelevant if the view is
  152.                                                          only one page wide or only one page high */
  153.  
  154.     Boolean fShowBreaks;                                /* TRUE iff page breaks should be displayed
  155.                                                          at the moment */
  156.  
  157.     Boolean fFinderSetup;
  158.        /* whether, during Finder Printing, the 'Page
  159.                                                          Setup' dialog should be presented to the
  160.                                                          user */
  161.  
  162.     Boolean fFinderJobDialog;
  163.        /* whether, during Finder Printing, the Print
  164.                                                          Job dialog should be presented to the user
  165.                                                          (making it seem like “Print...”) or not
  166.                                                          (making it seem like “Print One”) */
  167.  
  168.     Boolean fSquareDots;
  169.        /* if TRUE, then in the initial instance, use
  170.                                                          72 x 72 resolution by default on
  171.                                                          ImageWriter; if FALSE, then full 80 x 72
  172.                                                          is used. This flag has no significance if
  173.                                                          the default printer at the time of
  174.                                                          creation of the printHandler is not an
  175.                                                          ImageWriter */
  176.     Boolean fMinimalMargins;                            /* If TRUE, page margins are maintained such
  177.                                                          that exactly the complete printable area
  178.                                                          of the page is used. */
  179.  
  180.     Point fLastStrip;                                    /* The last strip printed. */
  181.  
  182.     VPoint fLastBreak;
  183.        /* The coordinates of the last page break. */
  184.  
  185.     VRect fViewedRect;                                    /* The part of the view shown on the
  186.                                                          "current" page. Set by SetPage. */
  187.  
  188.     Point fMarginRes;                                    /* Used when computing margins */
  189.  
  190.     GrafPtr fPrintDialog;
  191.        /* Used for all printing-related dialogs. ???
  192.                                                          (shouldn't this really be a view (or
  193.                                                          TDialogView if using UDialog) */
  194.     TPPrPort fPPrPort;                                    /* Printer Port in use during printing */
  195.                                 /* Initialization/Termination */
  196.     virtual pascal void IStdPrintHandler(TDocument *itsDocument, TView *itsView, Boolean 
  197.        itsSquareDots, Boolean itsHFixedSize, Boolean itsVFixedSize);
  198.                 /* Initializes the printHandler and installs it in the view; if 'itsSquareDots' is
  199.                 TRUE, then a default print record for the ImageWriter world will use square dots
  200.                 ('tall adjusted') rather than rectangular ones; this sacrifices a bit of resolution
  201.                 but ensures that graphics will appear undistorted on the printed page */
  202.  
  203.     virtual pascal void Free(void);
  204.  
  205.         /* If relevant, frees the PrintInfo record and does other cleanup before freeing SELF
  206.                 */
  207.  
  208.                 /* Page Strips */
  209.  
  210.     virtual pascal void CalcPageStrips(Point *pageStrips);
  211.                 /* Recalculate the number of strips of pages in each dimension */
  212.  
  213.     virtual pascal void CalcViewPerPage(VPoint *amtPerPage);
  214.                 /* Decide how much view (h and v) normally gets mapped into page interiors */
  215.  
  216.     virtual pascal VCoordinate BreakFollowing(VHSelect vhs, VCoordinate prevBreak, Boolean *
  217.        automatic);
  218.                 /* Returns the location of the page break which follows the page break located at
  219.                 'prevBreak', in direction vhs; returns automatic = TRUE if the page-break is
  220.                 thought of as an 'automatic' rather than a 'manual' (user-specified) one. Note that
  221.                 page-breaks in dimension 'v' are drawn as vertical lines, those in dimension 'h' as
  222.                 horizontal lines. Generic support at present is only provided for 'automatic' page
  223.                 breaks; the 'automatic' parameter in BreakFollowing is a hook to allow clients to
  224.                 support manual page breaks as well */
  225.  
  226.     virtual pascal void EachBreak(VHSelect vhs, Boolean includeLast, pascal Boolean (*DoToBreak)(
  227.        VCoordinate loc, Boolean automatic, void *DoToBreak_StaticLink), void *DoToBreak_StaticLink);
  228.  
  229.         /* Iterates through all page-breaks in the dimension given by vhs, or until DoToBreak
  230.                 returns true; the trailing edge of the view (i.e., right or bottom edge) is given
  231.                 as the final break if 'includeLast' is TRUE. The function 'DoToBreak' is called
  232.                 once for each page break in the chosen dimension */
  233.  
  234.     virtual pascal void GetBreakCoord(VHSelect vhs, short whichBreak, VCoordinate *loc);
  235.                 /* Returns, in 'loc', the coordinate of the 'whichBreak-th' page break in dimension
  236.                 vhs. For example, GetBreakCoord(v, 5, loc) will return, in 'loc', the horizontal
  237.                 coordinate of the vertical line (page-break) which marks the boundary the area of
  238.                 the view which will be mapped into the 4th vertical strip of pages and the area of
  239.                 the view which will be mapped into the 5th vertical strip of pages */
  240.  
  241.     virtual pascal Point PageToStrip(short pageNumber);
  242.                 /* Returns the horizontal and vertical strip for the given page. */
  243.  
  244.     virtual pascal short StripToPage(short hStrip, short vStrip);
  245.                 /* Returns the page number for the given page strip. */
  246.  
  247.     virtual pascal Point PointToPageStrip(VPoint *pointInView);
  248.                 /* Returns the page strip for a given point in view space. */
  249.  
  250.                 /* General Utility */
  251.  
  252.     virtual pascal void GetDocName(StringPtr docName);
  253.                 /* Returns the name of the document being printed, for use in the print dialog. */
  254.  
  255.     virtual pascal void DoInMacPrint(pascal void (*WhatToDo)(void *WhatToDo_StaticLink), void *
  256.        WhatToDo_StaticLink);
  257.                 /* If printing code is available, open the Print Driver, then call procedure
  258.                 “WhatToDo”, then close the Print Driver. If printing code not available,
  259.     does
  260.                 nothing */
  261.  
  262.     virtual pascal void OpenPrintShop(void);
  263.                 /* Attempts to open the print shop by calling PrOpen. Signals failure if an error
  264.                 occurs. Called from DoInMacPrint. */
  265.  
  266.     virtual pascal void ClosePrintShop(void);
  267.                 /* Closes the print shop by calling PrClose. DOES NOT signal failure if an error
  268.                 occurs, only reports it to the debug window. */
  269.  
  270.     virtual pascal short MaxPageNumber(void);
  271.                 /* Returns the highest page number which would be printed if the user requested that
  272.                 “all pages” be printed */
  273.  
  274.     virtual pascal void AdornPage(void);
  275.                 /* Draw things on page # 'aPageNumber' which do not arise from the View but rather
  276.                 from page considerations; examples: Headers and Footers; page numbers; frames drawn
  277.                 around inset text; row and column headers for spreadsheets. */
  278.  
  279.     virtual pascal void ChooseSpoolFile(StringPtr spoolFileName, short *spoolVRefNum, short *
  280.        pagesPerSubjob);
  281.  
  282.        /* Select the filename and volume to use for spooling; default chooses empty string on
  283.                 vol 0, which results in MacPrint's automatically choosing the local Boot volume */
  284.  
  285.     virtual pascal void DrawPageInterior(void);
  286.                 /* Make the QuickDraw calls which will result in the 'Interior' of page #
  287.                 'aPageNumber' being drawn. The 'Interior' is those things on the page which arise
  288.                 from drawing the View associated with the PrintHandler */
  289.  
  290.     virtual pascal void FocusOnBorder(void);
  291.                 /* Set up GrafPort, clipping, etc., prior to calling AdornPage */
  292.  
  293.     virtual pascal void FocusOnInterior(void);
  294.                 /* Set up the GrafPort, clipping, etc., prior to calling DrawPageInterior */
  295.  
  296.     virtual pascal void LocatePageInterior(short pageNumber, Point *loc);
  297.                 /* Determine where to locate the top-left corner of the Interior of the given page
  298.                 nuamber */
  299.  
  300.     virtual pascal TCommand *OneSubJob(short subjobFirstPage, short subjobLastPage, Boolean 
  301.        justSpool, Boolean partialJob, Boolean *ranOutOfSpace, short *lastPageTried, Boolean *proceed
  302.        );
  303.                 /* Processes one subjob for printing. Where appropriate, a print job is divided
  304.                 automatically into one or more 'subjobs', so that a long document can be printed
  305.                 even if there is very limited spool space available on the disk. This is a
  306.                 generalization of the 'spool-a-page/print-a-page' technique. TStdPrintHandler will
  307.                 use a subjob size as large as can be handled by current conditions, and will only
  308.                 fall back to more subjobs, each of smaller size, if it experiences problems running
  309.                 with a larger subjob size */
  310.  
  311.     virtual pascal TCommand *Print(CmdNumber itsCmdNumber, Boolean *proceed);
  312.                 /* Carries out printing for the print handler. */
  313.  
  314.     virtual pascal void PrintPage(short aPageNumber);
  315.                 /* Print the indicated page */
  316.  
  317.     virtual pascal void SetPage(short aPageNumber);
  318.                 /* Forwards to TView.DoSetInterior and TView.DoSetPageOffset */
  319.  
  320.     virtual pascal void SetPageInterior(short pageNumber);
  321.                 /* Responsible for installing the correct values into fPageAreas.theInterior,
  322.  
  323.                 representing the 'interior' of the page in View coordinates */
  324.  
  325.     virtual pascal void SetPageOffset(VPoint *coord);
  326.                 /* Given the view-coordinate of the top-left-most point of the view which is mapped
  327.                 into the interior of this page, calculate and set the offset for the print code. */
  328.  
  329.                 /* Formatting for printing and other Setup methods */
  330.  
  331.     virtual pascal void CheckPrinter(void);
  332.                 /* Check to see if user has changed printer specifications; if so, react */
  333.  
  334.     virtual pascal void InstallMargins(Rect *newMargins, Boolean areMinimalMargins);
  335.  
  336.         /* Install the (possibly new) margins specified; if 'areMinimalMargins' is TRUE, then
  337.                 the minimal-margins scheme is used; in this scheme, margins are always maintained
  338.                 at exactly the size necessary to have the page Interior coincide exactly with the
  339.                 printable area of the page */
  340.  
  341.     virtual pascal void PrinterChanged(void);
  342.  
  343.         /* After printer specifications have changed, absorb the new metrics and reformat the
  344.                 view if necessary */
  345.  
  346.     virtual pascal void RedoPageBreaks(void);
  347.                 /* Recalculate the page breaks */
  348.  
  349.     virtual pascal void Reset(void);
  350.                 /* Reset print record to default */
  351.  
  352.     virtual pascal void SetDefaultPrintInfo(void);
  353.                 /* Create a PrintInfo record and initialize it to default values */
  354.  
  355.     virtual pascal void SetPrintExtent(void);
  356.  
  357.        /* Sets the part of the print handler's view that is printed by this print handler, by
  358.                 calling the view's GetPrintExtent. */
  359.  
  360.     virtual pascal void SetMargins(void);
  361.                 /* Install the desired page margins */
  362.  
  363.     virtual pascal void ValidatePrintRecord(Boolean *didChange);
  364.                 /* Make certain that the current Print Record is compatible with the user's current
  365.                 printer choice; 'didChange' is set to TRUE iff the kind of printer changed */
  366.  
  367.                 /* Menu Commands */
  368.  
  369.     virtual pascal TCommand *DoMenuCommand(CmdNumber aCmdNumber);
  370.                 /* Handles 'show page breaks', among others */
  371.  
  372.     virtual pascal void DoSetupMenus(void);
  373.                 /* Sets up menus for 'show page breaks' and company */
  374.  
  375.                 /* Finder Printing */
  376.  
  377.     virtual pascal Boolean SetupForFinder(void);
  378.                 /* Sets up the print record for finder printing. If fFinderPageSetup is true, then
  379.                 PosePageSetupDialog is called. If fFinderJobDialog is true, then PoseJobDialog is
  380.                 called. Otherwise, prJobMerge is called to merge the job record from the */
  381.  
  382.     virtual pascal Boolean SetupPrintOne(void);
  383.  
  384.         /* Sets up the print record for a "print one" type of operation, one where the entire
  385.                 document or view is printed and no job dialog takes place. Returns true if we
  386.                 should proceed. */
  387.  
  388.                 /* Screen Feedback */
  389.  
  390.     virtual pascal void DrawPrintFeedback(Rect *area);
  391.                 /* Gateway to all screen feedback related to pagination issues */
  392.  
  393.     virtual pascal void DrawPageBreak(VHSelect vhs, short whichBreak, VCoordinate loc, Boolean 
  394.        automatic);
  395.                 /* Draws a page break on the screen. */
  396.  
  397.     virtual pascal void InvalPageFeedback(void);
  398.                 /* Invalidates all page-related screen feedback */
  399.  
  400.     virtual pascal Boolean ShowsOnScreen(void);
  401.                 /* Returns TRUE only if the printHandler has an fView which is in an open window. */
  402.  
  403.                 /* Dialogs relating to printing */
  404.  
  405.     virtual pascal Boolean PoseJobDialog(void);
  406.                 /* Pose the 'Print Job' dialog */
  407.  
  408.     virtual pascal TCommand *PosePageSetupDialog(Boolean *proceed, Boolean isUndoable);
  409.                 /* Undertake the 'Page Setup' dialog; return a command object to be performed if
  410.                 relevant */
  411.  
  412.     virtual pascal void PosePrintDialog(void);
  413.                 /* Put up the 'Printing in Progress' dialog */
  414.  
  415.     virtual pascal void ShowDocBeingPrinted(Boolean entering);
  416.  
  417.         /* Put up (or remove) a window whose title is the document's title, because the Print
  418.                 Manager gets the document title from the front window. */
  419.  
  420.     virtual pascal void BanishPrintDialog(void);
  421.                 /* Get rid of the print dialog. */
  422.  
  423.     virtual pascal void DoPrintIdling(void);
  424.                 /* Print job idle time handler. Handles events in the 'Print Dialogs' which give the
  425.                 user 'Cancel', and, in the case of printing from the Finder, 'Cancel All Printing.
  426.                 */
  427.  
  428.     virtual pascal void ChkPrintErr(OSErr *err, Boolean *proceed, Boolean *ranOutOfSpace);
  429.                 /* Checks for a MacPrint error, but only if 'proceed' is TRUE on entry; specially
  430.                 handles one particular error (sets return parameter 'ranOutOfSpace' if error code
  431.                 indicates disk-space problem while saving a spool file). */
  432.  
  433.     virtual pascal void PrintSpoolFile(Handle anHPrint, OSErr *err, Boolean *proceed);
  434.                 /* If printing was spooled by the print-driver then this Method will be called
  435.                 to print the spooled image. */
  436.  
  437.     virtual pascal void GetDriverName(StringPtr driverName);
  438.                 /* Get the name of the current printer driver. */
  439.  
  440.                 /* Debugging */
  441.  
  442.     virtual pascal void IdentifySoftware(void);
  443.                 /* Shows the version of the Printing Unit being used; display is in
  444.                 the Debug window */
  445.  
  446.     virtual pascal void Fields(pascal void (*DoToField)(StringPtr fieldName, Ptr fieldAddr, short 
  447.        fieldType, void *DoToField_StaticLink), void *DoToField_StaticLink);
  448.                 /* Used by the Inspector and the Debugger to display the contents of this classes
  449.                 fields. */
  450. };
  451.  
  452. /*--------------------------------------------------------------------------------------
  453.    ------------*/
  454. class TPrintStyleChangeCommand : public TCommand {
  455.   public:
  456.    /* Used to allow changes made by the user in
  457.                                                           the 'Page Setup...' dialog to be
  458.                                                           undoable. */
  459.  
  460.             /* Fields */
  461.  
  462.     TStdPrintHandler *fStdPrintHandler;                    /* Associated print handler */
  463.  
  464.     Handle fOldHPrint;
  465.        /* The old print record, before the change */
  466.     Handle fNewHPrint;                                    /* The new print record, after the change */
  467.  
  468.                                 /* Initialization and Termination */
  469.  
  470.     virtual pascal void IPrintStyleChangeCommand(TStdPrintHandler *itsPrintHandler);
  471.                 /* Initializes the print style change command, makes a copy of the old print handle
  472.                 and creates the new one. */
  473.     virtual pascal void Free(void);
  474.                 /* Disposes the old and new print handles. */
  475.  
  476.                 /* Command Execution */
  477.  
  478.     virtual pascal void DoIt(void);
  479.                 /* Calls CheckPrinter, finding it changed will dispatch to views DoPrinterChanged
  480.                 method. */
  481.  
  482.     virtual pascal void UndoIt(void);
  483.  
  484.        /* Copies the old print handle back and calls CheckPrinter which will in turn call the
  485.                 views DoPrinterChanged method. */
  486.  
  487.     virtual pascal void RedoIt(void);
  488.  
  489.        /* Copies the new print handle back and calls CheckPrinter which will in turn call the
  490.                 views DoPrinterChanged method. */
  491.  
  492.                 /* Debugging */
  493.     virtual pascal void Fields(pascal void (*DoToField)(StringPtr fieldName, Ptr fieldAddr, short 
  494.        fieldType, void *DoToField_StaticLink), void *DoToField_StaticLink);
  495.                 /* Used by the Inspector and the Debugger to display the contents of this class's
  496.                 fields. */
  497.  
  498. };
  499.  
  500. /*--------------------------------------------------------------------------------------
  501.    ------------*/
  502. class TPrintCommand : public TNoChangesCommand {
  503.   public:     /* Returned in response to a printing
  504.                                                               request. Doesn't actually do the
  505.                                                               printing itself, but forwards to the
  506.                                                               appropriate handler. */
  507.  
  508.     TStdPrintHandler *fStdPrintHandler;                    /* the associated print handler */
  509.  
  510.     virtual pascal void IPrintCommand(CmdNumber itsCmdNumber, TStdPrintHandler *itsStdPrintHandler);
  511.                 /* Initialize the PrintCommand procedurally */
  512.  
  513.     virtual pascal void DoIt(void);
  514.                 /* Tell the print handler to print */
  515.  
  516.     virtual pascal void Fields(pascal void (*DoToField)(StringPtr fieldName, Ptr fieldAddr, short 
  517.        fieldType, void *DoToField_StaticLink), void *DoToField_StaticLink);
  518.                 /* Used by the Inspector and the Debugger to display the contents of this class's
  519.                 fields. */
  520.  
  521. };
  522.  
  523. extern pascal PenState gBreaksPenState;                    /* penState to used to draw page breaks */
  524. extern pascal Boolean gCancelAllPrinting;
  525.    /* set to TRUE if during Finder Printing user
  526.                                                          selects “Cancel All” */
  527. extern pascal Rect gStdPageMargins;                        /* "Standard" left, top, right, bottom page
  528.                                                          margins, in screen resolution - one inch
  529.                                                          all round by default */
  530. extern pascal Handle gFinderHPrint;
  531.    /* Used for finder printing, to do PrJobMerge
  532.                                                          when printing more than one document. */
  533.  
  534. extern pascal TStdPrintHandler *gJobPrintHandler;        /* The Print Handler in use during printing.
  535.                                                          */
  536.  
  537.             /* Initialization */
  538.  
  539. extern pascal void InitUPrinting(void);
  540.         /* Call once, at application start-up time. You can interrogate global variable 'gCouldP
  541.            rint'
  542.         at any time to determine whether printing code is actually accessible */
  543.  
  544. extern pascal void InitPrinting(void);
  545.         /* Synonym for InitUPrinting.  Left in for compatibility (2.0) */
  546.  
  547. extern pascal void IdleProcForTStdPrintHandler(void);
  548.         /* Procedure whose address is passed to the print job for calling as often as possible.
  549.         Forwards to the DoPrintIdling method of the job's print handler. */
  550.  
  551. #endif
  552.  
  553.